home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / share / insserv / make-testsuite < prev    next >
Encoding:
Text File  |  2010-05-07  |  719 b   |  42 lines

  1. #!/bin/sh
  2. #
  3. # Extract key information from the current to try to generate a test
  4. # suite script to demonstrate detected bugs.
  5.  
  6. echo 'set +C'
  7. echo "cat <<'EOF' > \$insconf"
  8. grep -v '#' /etc/insserv.conf |grep -v '^$'
  9. echo "EOF"
  10. echo 'set -C'
  11. echo
  12.  
  13. for f in /etc/init.d/*; do
  14.     name=$(basename $f)
  15.     case $name in
  16.         README|rc|rcS|skeleton)
  17.             ;;
  18.         *)
  19.         echo "addscript $name <<'EOF'"
  20.         sed -n -r '/^### BEGIN INIT INFO/, /END INIT INFO/p' < $f
  21.         echo "EOF"
  22.         echo
  23.         ;;
  24.     esac
  25. done
  26.  
  27. echo 'cd $tmpdir/etc'
  28. echo 'mkdir rc0.d rc1.d rc2.d rc3.d rc4.d rc5.d rc6.d rcS.d'
  29. cd /etc
  30. for f in rc?.d/*; do
  31.     case $f in
  32.         */README)
  33.             ;;
  34.         *)
  35.         echo ln -s $(readlink $f) $f
  36.         ;;
  37.     esac
  38. done
  39.  
  40. echo
  41. echo list_rclinks
  42.